package com.woniuxy02;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-07-16 16:46
 */
public class Test13 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入一个数字");
        int number = sc.nextInt();
        //true是质数
        boolean flag=true;
        int i;
        for(i=2;i<=number-1;i++){
            if(number%i==0){
                flag=false;
                break;
            }
        }
        //下结论
        if(i==number){
            System.out.println("是质数");
        }else{
            System.out.println("不是质数");
        }
        System.out.println("程序结束");
    }
}
